const Service = require('egg').Service
class HomeService extends Service {
    async user () {
        const { ctx, app } = this
        const QUERY_STR = 'id, name';
        let sql = `select ${QUERY_STR} from user`

        try {
            const result = await app.mysql.query(sql)
            return result
        } catch (err) {
            console.log(err);
            return null
        }
    }

    async login () {
        const { ctx, app } = this
        // const sql = 
    }
}
module.exports = HomeService

